/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx.pojo;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

/**
 * <p>Project: spring2021 - Log
 * <p>Powered by webrx On 2021-11-02 17:49:21
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */

@Component
@Aspect
public class Log {

    @Before("execution(public * cn.webrx.pojo..Db.*(..)),execution(public * cn.webrx.pojo..User.*(..))")
    public void connect(){
        System.out.println("Log.connect() 数据库连接");
    }

    @After("execution(public * cn.webrx.pojo..*.*(..))")
    public void close(){
        System.out.println("log(销毁连接)");
    }
}
